<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('实际可控费用')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="plancontrolcost-form">
                <div class="select-list">
                    <ul>
                        <li>
                            项目名称：<input type="text" name="jspmName" id="jspmName"/>
                        </li>
                        <li>
                            年：
                            <select name="year" id="year">
                                <option value="">全部</option>
                                <option value="2018">2018</option>
                                <option value="2019">2019</option>
                                <option value="2020">2020</option>
                            </select>
                        </li>
                        <li>
                            月：
                            <select name="month" id="month">
                                <option value="">全部</option>
                                <option value="1">1</option>
                                <option value="2">2</option>
                                <option value="3">3</option>
                                <option value="4">4</option>
                                <option value="5">5</option>
                                <option value="6">6</option>
                                <option value="7">7</option>
                                <option value="8">8</option>
                                <option value="9">9</option>
                                <option value="10">10</option>
                                <option value="11">11</option>
                                <option value="12">12</option>
                            </select>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>
        <div class="btn-group-sm" id="toolbar" role="group">
            <button class="btn btn-success" onclick="$.operate.add()"><i class="fa fa-plus"></i> 新增</button>
            <button class="btn btn-primary single disabled" onclick="$.operate.edit()"><i class="fa fa-edit"></i> 修改</button>
            <button class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()"><i class="fa fa-remove"></i> 删除</button>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-suggest-js"/>
<th:block th:include="include :: bootstrap-typeahead-js"/>

<script th:inline="javascript">
    var prefix = ctx + "jianshe/realcontrolcost";

    $(function () {
        queryrealcontrolcostList();
    });

    function queryrealcontrolcostList() {
        var options = {
            code: "id",
            uniqueId: "id",
            createUrl: prefix + "/add",
            removeUrl: prefix + "/remove",
            updateUrl: prefix + "/edit/{id}",
            url: prefix + "/list",
            modalName: "实际可控费用",
            columns: [{
                checkbox: true
            },
                {
                    field: 'jspmName',
                    title: '项目名称'
                },
                {
                    field: 'realControlcost',
                    title: '计划可控费用',
                },
                {
                    field: 'year',
                    title: '年',
                },
                {
                    field: 'month',
                    title: '月',
                },
                {
                    field: 'remarks',
                    title: '备注',
                },
                {
                    field: 'gmtCreate',
                    title: '创建时间',
                },
                {
                    field: 'gmtModified',
                    title: '更新时间',
                },
                {
                    field: 'proportion',
                    title: '比例',
                }]
        };
        $.table.init(options);
    }

    $.get(ctx + "jianshe/fomation/getJspmRow", function (data) {
        console.log(data);
        $("#jspmName").typeahead({
            source: data.value
        });
    }, 'json');
</script>
</body>
</html>